/*
 Navicat Premium Data Transfer

 Source Server         : mysql
 Source Server Type    : MySQL
 Source Server Version : 80027
 Source Host           : localhost:3306
 Source Schema         : kdc_db

 Target Server Type    : MySQL
 Target Server Version : 80027
 File Encoding         : 65001

 Date: 11/01/2022 16:15:22
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for car_brand
-- ----------------------------
DROP TABLE IF EXISTS `car_brand`;
CREATE TABLE `car_brand` (
  `brand_id` int NOT NULL,
  `brand_name` varchar(255) NOT NULL,
  PRIMARY KEY (`brand_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of car_brand
-- ----------------------------
BEGIN;
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (1, '奥迪');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (2, '宝马');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (3, '奔驰');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (4, '大众');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (5, '现代');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (6, '长城');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (7, '红旗');
INSERT INTO `car_brand` (`brand_id`, `brand_name`) VALUES (8, '长安');
COMMIT;

-- ----------------------------
-- Table structure for car_info
-- ----------------------------
DROP TABLE IF EXISTS `car_info`;
CREATE TABLE `car_info` (
  `info_id` int NOT NULL,
  `info_name` varchar(255) NOT NULL,
  `car_brand_id` int NOT NULL,
  `car_brand_name` varchar(255) NOT NULL,
  PRIMARY KEY (`info_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of car_info
-- ----------------------------
BEGIN;
INSERT INTO `car_info` (`info_id`, `info_name`, `car_brand_id`, `car_brand_name`) VALUES (1, '奥迪A4', 1, '奥迪');
INSERT INTO `car_info` (`info_id`, `info_name`, `car_brand_id`, `car_brand_name`) VALUES (2, '奥迪A6', 1, '奥迪');
INSERT INTO `car_info` (`info_id`, `info_name`, `car_brand_id`, `car_brand_name`) VALUES (3, '宝马X5', 2, '宝马');
INSERT INTO `car_info` (`info_id`, `info_name`, `car_brand_id`, `car_brand_name`) VALUES (4, '大众帕萨特', 4, '大众');
INSERT INTO `car_info` (`info_id`, `info_name`, `car_brand_id`, `car_brand_name`) VALUES (5, '大众朗逸', 4, '大众');
COMMIT;

-- ----------------------------
-- Table structure for car_photo
-- ----------------------------
DROP TABLE IF EXISTS `car_photo`;
CREATE TABLE `car_photo` (
  `photo_id` int NOT NULL,
  `photo_name` varchar(255) NOT NULL,
  `photo_path` varchar(255) DEFAULT NULL,
  `car_id` int DEFAULT NULL,
  PRIMARY KEY (`photo_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of car_photo
-- ----------------------------
BEGIN;
INSERT INTO `car_photo` (`photo_id`, `photo_name`, `photo_path`, `car_id`) VALUES (1, '蓝色照片1', 'http://xxxxx.png', 1);
INSERT INTO `car_photo` (`photo_id`, `photo_name`, `photo_path`, `car_id`) VALUES (2, '蓝色照片2', 'http://xxxxx.png', 1);
COMMIT;

-- ----------------------------
-- Table structure for stock_car
-- ----------------------------
DROP TABLE IF EXISTS `stock_car`;
CREATE TABLE `stock_car` (
  `stock_id` int NOT NULL,
  `car_info_id` int NOT NULL,
  `car_info_name` varchar(255) NOT NULL,
  `car_brand_id` int NOT NULL,
  `car_brand_name` varchar(255) NOT NULL,
  `shop_id` int NOT NULL,
  `car_color` varchar(255) DEFAULT NULL,
  `car_photos` varchar(255) DEFAULT NULL,
  `car_state` int DEFAULT '0',
  `car_status` int NOT NULL,
  `plate _number` varchar(100) DEFAULT NULL,
  `car_city` varchar(100) NOT NULL,
  `city_code` int NOT NULL,
  PRIMARY KEY (`stock_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of stock_car
-- ----------------------------
BEGIN;
INSERT INTO `stock_car` (`stock_id`, `car_info_id`, `car_info_name`, `car_brand_id`, `car_brand_name`, `shop_id`, `car_color`, `car_photos`, `car_state`, `car_status`, `plate _number`, `car_city`, `city_code`) VALUES (1, 1, '奥迪A4', 1, '奥迪', -1, '', '', 0, 0, '', '北京', 10010);
COMMIT;

-- ----------------------------
-- Table structure for user_info
-- ----------------------------
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
  `user_id` int NOT NULL AUTO_INCREMENT,
  `user_nick` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户昵称',
  `user_avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `user_phone` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
  `user_password` varchar(255) NOT NULL DEFAULT '',
  `user_vip_level` int NOT NULL DEFAULT '0',
  `user_integral` int NOT NULL DEFAULT '0',
  `user_disable` int NOT NULL DEFAULT '0' COMMENT '0 正常使用 1 禁用 2注销',
  `register_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb3;

-- ----------------------------
-- Records of user_info
-- ----------------------------
BEGIN;
INSERT INTO `user_info` (`user_id`, `user_nick`, `user_avatar`, `user_phone`, `user_password`, `user_vip_level`, `user_integral`, `user_disable`, `register_time`) VALUES (7, '徐勇江', 'http://xxxx.png', '15810551131', '1234567', 0, 0, 0, '2022-01-08 11:26:24');
INSERT INTO `user_info` (`user_id`, `user_nick`, `user_avatar`, `user_phone`, `user_password`, `user_vip_level`, `user_integral`, `user_disable`, `register_time`) VALUES (8, '苏晓莉', 'http://xxxx.png', '18032741480', '1234567', 0, 0, 0, '2022-01-08 11:28:37');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
